(import
  ;; unit tests
  (srfi srfi-64)
  ;; module to test
  (lib utils list-utils))


(test-begin "list-utils-test")

(test-group
 "list-prefixes-test"

 (test-equal "gives all list prefixes -- 00"
   '(("static") ("static" "img"))
   (list-prefixes '("static" "img" "logo.png")))

 (test-equal "gives empty list for one element lists -- 00"
   '()
   (list-prefixes '("static")))

 (test-equal "gives empty list for zero element lists -- 00"
   '()
   (list-prefixes '())))


(test-group
 "list-prefixes-long-to-short-test"

 (test-equal "gives all list prefixes -- 00"
   '(("static" "img") ("static"))
   (list-prefixes-long-to-short '("static" "img" "logo.png")))

 (test-equal "gives empty list for one element lists -- 00"
   '()
   (list-prefixes-long-to-short '("static")))

 (test-equal "gives empty list for zero element lists -- 00"
   '()
   (list-prefixes-long-to-short '())))

(test-end "list-utils-test")
